/*********************************************************************/
/*					  COVID Community Survey						 */
/*					Care Disruption Analysis						 */
/*				Limited dataset for eLife manuscript				 */
/*						Nicole Ackermann							 */	
/*					 Last updated:08/04/2023						 */	
/*********************************************************************/


libname care_dis "Set File Path Here";
options fmtsearch=(care_dis); *Make sure to share format file where ever your care_dis library is*;


*Creating working dataset for analysis below*;
data covid_No_DNA;
	set care_dis.covid_care_disrupt;
run;
	proc contents data=covid_No_DNA varnum; run;
	proc contents data=care_dis.covid_care_disrupt varnum; run;

**********************************************Cleaning data and variable creation code******************************************************;
**********************************************Cleaning data and variable creation code******************************************************;
**********************************************Cleaning data and variable creation code******************************************************;
**********************************************Cleaning data and variable creation code******************************************************;
*Note for lab staff -- this code was taken from the overall data management file and paired down here for the selected applicable variables
	used in this analysis*;

/**Note -- these variables are already created in the dataset, no need to re-run code, however, they are listed here to see how 
		variables were coded*;
data covid_No_DNA;
	set covid_No_DNA;

	*Recoding race into non-hispanic white, non-hispanic black,
		and other (including hispanic) for modeling purposes*;
		*Note there is no missing race and only 1 missing ethnicity so that will be in 
			the other category for now*;
		*1=NH white, 2=NH black, 3=other*;
		if race_recode=1 and Q11=2 then race_3cat=1;
		else if race_recode=2 and Q11=2  then race_3cat=2;
		else race_3cat=3;
		label race_3cat='Race recoded: NH White, NH Black, and All Other';

	*Sex assigned at birth recoded, with prefer not to answer missing*;
		if q114=12 then sex=.;
		else sex=q114;

	*Creating discrimination overall score (average score)*;
		nmiss_discrim=cmiss(of Q48_1 - Q48_7);
		*there are 2 with 5 and 6 missing (in full sample) so making them have missing values for the scale*;
		if nmiss_discrim le 1 then do;
			Discrimination=mean(of Q48_1 - Q48_7);
		end;
		else if nmiss_discrim > 1 then Discrimination=.;
		label Discrimination='Discrimination overall score (average of Q48_1 - Q48_7)';

	*Creating no care disruption vs. some care disruption variable*;
		*Use variables: Q78_1 and cancer screening postponements, NOT dental (Q78_2)
			or avoiding hospital care (Q78_3) or HPV because that was about their children (Q77)*;
		if Q78_1=1 or Q66 in (1,2) or Q68 in (1,2)
			or Q70 in (1,2) or Q72 in (1,2) or Q74 in (1,2) then Care_Disruption=1;
		else Care_Disruption=0;
		label Care_Disruption='Did patient experience some care disruption? Combining vars: Q78_1 and cancer screening postponements (Q66, Q68, Q70, Q72, Q74)';

	*Recode transportation variable*;
		if Q24_1=1 or Q24_6_TEXT='Drive my car' then CarTransportation=1;
		else CarTransportation=0;
		label CarTransportation='Does participant have a private vehicle mode of transportation? (recode of Q24_1 - Q24_6)';

	*Creating laid off or closed business job for individual*;
		if Q37_1_1=1 then LaidOff_CloseBus_Self=1;
		else if Q37_1_3=1 then LaidOff_CloseBus_Self=2;
		else if Q37_1_4=1 or Q37_1_5=1 then LaidOff_CloseBus_Self=3;
		else if  Q37_1_6=1 then LaidOff_CloseBus_Self=4;
		else if Q37_1_2=1 and Q37_1_1 ne 1 then LaidOff_CloseBus_Self=2;

run;


********************************Formats*********************************************************************;
********************************Formats*********************************************************************;
********************************Formats*********************************************************************;

**Format creation code**;
proc format library=care_dis;
	value laid_off 1='Yes'
					2='No'
					3='Dont Know/Not Sure/Prefer not to Answer/Not applicable';
	value race_recode 1='White'
					  2='Black or African American'
					  3='Asian or Native Hawaiian or Other Pacific Islander'
					  4='Other, including multiple groups';
	value race_3cat 1='Non-Hispanic White'
					2='Non-Hispanic Black'
					3='All Other';
	value sex 10='Female'
				11='Male'
				12='Prefer not to answer';
	value gender_ident_two 1='Man'
						2='Woman'
						3='Transgender/Gender Diverse'
						5='Agender/No gender'
						6='Something else(please specify)'
						7='Prefer not to answer';
	value LGBTQIA 1='LGBTQIA+'
				  2='Straight or Heterosexual'
				  3='Prefer not to answer';
	value educationRC 1='Less than High school graduate or GED'
					2='Grade 12 or GED (High school graduate)'
					3='Some college, but did not graduate'
					4='Associates Degree or Technical School Certification'
					5='College 4 years or more (College graduate)'
					6='Graduate or professional school';
	value income_two 1='$0 to $9,999'
				2='$10,000 to $14,999'
				3='$15,000 to $19,999'
				4='$20,000 to $34,999'
				5='$35,000 to $49,999'
				6='$50,000 to $74,999'
				7='$75,000 to $99,999'
				8='$100,000 or more';
	value employ_two 1='Employed Full-time'
					2='Employed Part-time'
					3='Unemployed'
					4='Homemaker'
					5='Student'
					6='Retired'
					7='Disabled'
					8='Self-Employed/Other';
	value insure_5cat 1='Private'
	                  2='Medicare+'
					  3='Medicaid'
					  4='Uninsured'
					  5='Other/Unknown';
	value me_house 1='Yes - me only'
					2='Yes - someone in house only'
					3='Yes - me and someone in house'
					4='No'
					5="Don't know, not sure, prefer not to answer, not applicable";

	value yesno 1='Yes'
				2='No';
	value yesnoind 1='Yes'
				   0='No';
	value yesnoDNA  1='Yes'
					2='No'
					3='Does Not Apply';
	value yesnoNA 1='Yes'
				  2='No'
				  3='Not applicable';
	value yesnoDKOth 1='Yes'
					2='No'
					3='Dont know/Not sure'
					4='Other (please specify)';
	value postpone 1='Yes, it was me'
				   2='Yes, it was my doctor or clinic'
				   3='No'
				   4='Dont know/Not sure';
	value caretype 1='Cancer care'
				   2='General health care'
				   3='Both';
	value discrim 1='Never'
				  2='Once'
				  3='2 or 3 times'
				  4='4 times or more';
	value return_care 1='Time to schedule the appointment'
					  2='To know if my doctors office is still'
					  3='To know how Im going to get to the doctors office (transportation)'
					  4='To know how Im going to pay for the doctors appointment'
					  5='To know that someone can come with me'
					  6='To know my doctors office or clinic is taking the appropriate COVID related safety precautions'
					  7='I dont need anything'
					  8='I am dealing with other things and not ready to reschedule yet.'
					  9='Other (please specify)'
					  10='To know my doctors office is making appointments for general or routine care';
run;


**Applying formats to variables**;
data covid_No_DNA;
	set covid_No_DNA;

	format 
		Q114 sex sex. race_recode race_recode. Gender_Identity gender_ident_two.
		q11 yesno. education_recode educationRC. income income_two.
		employment_PRECOVID employ_two. 
		LGBTQIA LGBTQIA. race_3cat race_3cat.
		Health_Insurance_5cat insure_5cat.
		CarTransportation yesnoind.

		q78_1 - q78_3 yesnoDNA.
		Care_Disruption yesnoind.
		Q65 Q67 Q69 Q71 Q73 yesnoDKOth.
		Q66 Q68 Q70 Q72 Q74  postpone.
		q79 return_care.

		q88 yesno. Q128 caretype. 

		Q48_1 - Q48_7 discrim.
		;
run;
*/


*****************************************Descriptive Analysis & Queries ***************************************************;
*****************************************Descriptive Analysis & Queries ***************************************************;
*****************************************Descriptive Analysis & Queries ***************************************************;
*****************************************Descriptive Analysis & Queries ***************************************************;

**Update 070623: num_comorbid_cat by race_3cat*;
proc freq data=covid_No_DNA;
	table race_3cat*Care_Disruption*num_comorbid_cat / nopercent norow nocol;
run;
proc freq data=covid_No_DNA;
	table race_3cat*num_comorbid_cat num_comorbid_cat / nopercent norow nocol nocum;
run;

**Update 042221: Metro by Telehealth crosstabs for KD**;
proc freq data=covid_No_DNA;
	table q88*RUCC_Metro_4 / nopercent;
run;
*Also checking race by metro with the correct classification 4*;
proc freq data=covid_No_DNA;
	table RUCC_Metro_4*race_3cat;
run;

******Update 020921: Numbers for methods section******;
*Median (range) time for survey completion*;
data covid_No_DNA;
	set covid_No_DNA;
	SurveyDuration_Mins=Duration__in_seconds_/60;
run;
	proc print data=covid_No_DNA (obs=50);
		var Duration__in_seconds_ SurveyDuration_Mins;
	run;

proc means data=covid_No_DNA median min max clm mean std;
	var Duration__in_seconds_ SurveyDuration_Mins;
	run;
	proc univariate data=covid_No_DNA;
		var SurveyDuration_Mins;
		histogram SurveyDuration_Mins;
	run;

*****Discrimination cronbach's alpha analysis -- overall and by race******;
***Race specific cronbach's alpha for discrimination***;
proc freq data=covid_No_DNA; table race_3cat; format _all_; run;
	*Black*;
	proc factor data=covid_No_DNA  corr simple method=prin rotate=varimax mineigen=1 plots=scree round flag=.35 ;
		var Q48_1 - Q48_7;
		where race_3cat=2;
	run;
		*Loads on one factor*;
		proc corr data=covid_No_DNA alpha nomiss;
			var Q48_1 - Q48_7;
			where race_3cat=2;
		run;
		*Cronbach's alpha=0.93*;

	*White*;
	proc factor data=covid_No_DNA  corr simple method=prin rotate=varimax mineigen=1 plots=scree round flag=.35 ;
		var Q48_1 - Q48_7;
		where race_3cat=1;
	run;
		*Loads on one factor*;
		proc corr data=covid_No_DNA alpha nomiss;
			var Q48_1 - Q48_7;
			where race_3cat=1;
		run;
		*Cronbach's alpha=0.91*;

	*Other*;
	proc factor data=covid_No_DNA  corr simple method=prin rotate=varimax mineigen=1 plots=scree round flag=.35 ;
		var Q48_1 - Q48_7;
		where race_3cat=3;
	run;
		*Loads on one factor*;
		proc corr data=covid_No_DNA alpha nomiss;
			var Q48_1 - Q48_7;
			where race_3cat=3;
		run;
		*Cronbach's alpha=0.94*;

	*Discrimination factor and cronbach's alpha for full sample - reported in text*;
		proc factor data=covid_No_DNA  corr simple method=prin rotate=varimax mineigen=1 plots=scree round flag=.35 ;
			var Q48_1 - Q48_7;
		run;
			*Loads on one factor*;
			proc corr data=covid_No_DNA alpha nomiss;
				var Q48_1 - Q48_7;
			run;
		*Cronbach's alpha: 0.92*;

************************Table 1 - Demographics by care disruption**************************;
*Demographics - full sample*;
	proc freq data=covid_No_DNA;
		table race_recode Q11 Gender_Identity Q114 LGBTQIA Health_Insurance_5cat
			education_recode  income  employment_PRECOVID  education_recode RUCC_Metro_4 CarTransportation 
			Q88 Q128 LaidOff_CloseBus_Self race_3cat;
		table race_recode*Q11;
	run;
	proc means data=covid_No_DNA n nmiss mean std median min max;
		var q7 discrimination;
	run;
	
*Demographics - by care disruption category*;
	proc freq data=covid_No_DNA;
		table (race_recode Q11 Gender_Identity Q114 LGBTQIA Health_Insurance_5cat CarTransportation
			education_recode  income  employment_PRECOVID education_recode RUCC_Metro_4
				Q88 Q128 LaidOff_CloseBus_Self)*Care_Disruption/ norow nopercent ;
		table Care_Disruption*race_recode*Q11;
	run;
		*Statistically significant difference between groups? Chi-sq for most vars, MH for ordinal*;
			proc freq data=covid_No_DNA;
				table (race_recode Q11 Gender_Identity Q114 LGBTQIA Health_Insurance_5cat CarTransportation
					  income  employment_PRECOVID education_recode RUCC_Metro_4
						Q88 Q128 LaidOff_CloseBus_Self)*Care_Disruption/ chisq ;
			run;
			*Significant for: education, q114, Gender_Identity*;
			*Fisher's test for q114 Gender_Identity - expected cell counts small*;
			proc freq data=covid_No_DNA;
				table (q114 Gender_Identity)*Care_Disruption/ chisq exact ;
			run;
			*Both are sex at birth and gender identify are significant*;

		*Continuous -- age and discrimination*;
		proc means data=covid_No_DNA n nmiss mean std median min max;
			var q7 discrimination;
			class Care_Disruption;
		run;
			*Ttest*;
				proc ttest data=covid_No_DNA;
					var q7;
					class Care_Disruption;
				run;
				proc ttest data=covid_No_DNA;
					var discrimination;
					class Care_Disruption;
				run;
				*Not significant for age, significant for discrimination but Data skewed so checking wilcoxon test*;
					proc npar1way data=covid_No_DNA wilcoxon;
						var q7;
						class Care_Disruption;
					run;
					proc npar1way data=covid_No_DNA wilcoxon;
						var discrimination;
						class Care_Disruption;
					run;


***********************Update 05 30 23 - Adding Supplementatl Table 2 - Demographics and covars by race**************;
***********************Update 05 30 23 - Adding Supplementatl Table 2 - Demographics and covars by race**************;
***********************Update 05 30 23 - Adding Supplementatl Table 2 - Demographics and covars by race**************;
proc freq data=covid_No_DNA;
		table Care_Disruption race_3cat;
		table (Care_Disruption Q11 Gender_Identity Q114 sexual_orientation LGBTQIA Health_Insurance_5cat CarTransportation
			education_recode  income  employment_PRECOVID employment_PRECOVID2 age_cat RUCC_Metro RUCC_Metro_4
				Q88 Q128 LaidOff_CloseBus_Self)*race_3cat/ norow nopercent ;
	run;
	*Continuous -- age and discrimination*;
		proc means data=covid_No_DNA n nmiss mean std median min max;
			var q7 discrimination;
			class race_3cat;
		run;


*********Figure 1 - Care Disruption by screening type******;
*Note this table was table  2 but moved into a figure now figure 1 in manuscript*;
proc freq data=covid_No_DNA;
	*Mammogram*;
	table Q65 Q66;
	*Pap test*;
	table Q67 Q68;
	*Blood stool*;
	table Q69 Q70 ;
	*Colonoscopy*;
	table Q71 Q72;
	*PSA test*;
	table Q73 Q74;
	*Cancer-related care*;
	table Q85 Q32;
run;
	*Getting numbers elgible for each test*;
	*Mamm*;
	proc means data=covid_No_DNA n;
		var q7;
		where Q114 in (10, 12) and q7 ge 40;
	run;
	*Pap*;
	proc means data=covid_No_DNA n;
		var q7;
		where Q114 in (10, 12) and q7 le 65;
	run;
	*Blood Stool/Colonoscopy*;
	proc means data=covid_No_DNA n;
		var q7;
		where q7 ge 45;
	run;
	*PSA Test*;
	proc means data=covid_No_DNA n;
		var q7;
		where Q114 in (11, 12) and q7 ge 40;
	run;


*************Numbers In text only*************;
	*What need most to reschedule appointment*;
	proc freq data=covid_No_DNA order=freq;
		table q79 Q79_9_TEXT ;
	run;
	*Cancelling medical, dental, avoiding hospital*;
	proc freq data=covid_No_DNA;
		table  q78_1 - q78_3;
	run;


*****************************************Multivariate logistic regression Analysis***************************************************;
*****************************************Multivariate logistic regression Analysis***************************************************;
*****************************************Multivariate logistic regression Analysis***************************************************;
*****************************************Multivariate logistic regression Analysis***************************************************;
*This sections includes analysis for table "Odds of Some  care disruption compared to no care disruption by 
	social factors across Missouri and Southern Illinois (July-August 2020)" of the eLife manuscript*;

*********************** Table 2 -- multivariate logistic regression model**********************;
*Outcome: Care_Disruption*;
*Predictors: race_3cat
	sex
	education_recode
	income
	Q7 (age)
	RUCC_Metro_4
	Discrimination
	Q88 (telehealth)*;


data covid_No_DNA;
	set covid_No_DNA;
	
	*recode prefer not to answer to missing for modeling*;
	if LGBTQIA=3 then LGBTQIA_2=.;
	else LGBTQIA_2=LGBTQIA;

	*Recoding don't know and not applicable into one category due to small numbers in 
		don't know cateogry for modeling*;
	if LaidOff_CloseBus_Self in (3,4) then LaidOff_CloseBus_Self_2=3;
	else LaidOff_CloseBus_Self_2=LaidOff_CloseBus_Self;

run;
	*Checking code*;
	proc freq data=covid_No_DNA;
		table race_3cat LGBTQIA*LGBTQIA_2 LaidOff_CloseBus_Self*LaidOff_CloseBus_Self_2 / list missing;
	run;

******Overall model -- full analytic sample (excluding does not apply care disruption) -- N=663******;
proc logistic data=covid_No_DNA plots=all order=internal;
	class race_3cat (ref='Non-Hispanic White') sex LGBTQIA_2 RUCC_Metro_4 (ref='Metro') Q88 (ref='No') CarTransportation (ref='No')
			Health_Insurance_5cat (ref='Private') LaidOff_CloseBus_Self_2 (ref='No')/ param=ref;
	model Care_Disruption (desc)= race_3cat sex LGBTQIA_2 education_recode RUCC_Metro_4 Q88 CarTransportation 
			Health_Insurance_5cat LaidOff_CloseBus_Self_2 Discrimination income Q7 education_recode/ lackfit rsquare;
	title 'Full model predicting probability of some care distruption -- continuous discrimination variable and RUCC metro cut off of 4 used';
	format LGBTQIA_2 LGBTQIA. LaidOff_CloseBus_Self_2 laid_off.;
run;

*****Update: check for multicollinearity*****;
*To check for multicollinearity, transform to PROC REG and check the VIF*;
		*Also added option corrb to model above to see correlation matrix -- all values under 0.5, nothing above 0.8*;
	*Need to recode variables that are not continuous or binary 0/1 variables:
		race_3cat *;
	proc freq data=covid_No_DNA;
		table race_3cat sex LGBTQIA_2 RUCC_Metro_4 Q88 CarTransportation Health_Insurance_5cat LaidOff_CloseBus_Self_2;
		format _all_;
	run;
		*Need to recode all except CarTransportation*;
	*Make sure continuous ones are OK*;
		proc freq data=covid_No_DNA;
			table education_recode income Q7 Discrimination;
			format _all_;
		run;

	*Recoding categorical variables so we can use them in proc reg*;
		data covid_No_DNA;
			set covid_No_DNA;

			*Recoding race*;
			if race_3cat=. then black=.;
			else if race_3cat=2 then black=1;
			else black=0;

			if race_3cat=. then other_race=.;
			else if race_3cat=3 then other_race=1;
			else other_race=0;

			*Recoding sex*;
			if sex=. then female=.;
			else if sex=10 then female=1;
			else if sex=11 then female=0;

			*Recoding LGBTQIA_2*;
			if LGBTQIA_2=1 then LGBTQIA_01=1;
			else if LGBTQIA_2=2 then LGBTQIA_01=0;

			*Recoding RUCC*;
			if RUCC_Metro_4='Metro' then RUCC_01=1;
			else if RUCC_Metro_4='Non-Metro' then RUCC_01=0;

			*Recoding telehealth*;
			if Q88=1 then telehealth_01=1;
			else if Q88=2 then telehealth_01=0;

			*Recoding Health_Insurance_5cat*;
			if Health_Insurance_5cat=2 then Medicare_01=1;
			else if Health_Insurance_5cat in (1,3,4,5) then  Medicare_01=0;

			if Health_Insurance_5cat=3 then Medicaid_01=1;
			else if Health_Insurance_5cat in (1,2,4,5) then  Medicaid_01=0;

			if Health_Insurance_5cat=4 then Uninsured_01=1;
			else if Health_Insurance_5cat in (1,2,3,5) then  Uninsured_01=0;

			if Health_Insurance_5cat=5 then OtherInsure_01=1;
			else if Health_Insurance_5cat in (1,2,3,4) then  OtherInsure_01=0;

			*Recoding LaidOff_CloseBus_Self_2*;
			if LaidOff_CloseBus_Self_2=1 then LaidOff_01=1;
			else if LaidOff_CloseBus_Self_2 in (2,3) then  LaidOff_01=0;

			if LaidOff_CloseBus_Self_2=3 then LaidOffDK_01=1;
			else if LaidOff_CloseBus_Self_2 in (1,2) then  LaidOffDK_01=0;

		run;
			*Checking recodes*;
			proc freq data=covid_No_DNA;
				table race_3cat*black race_3cat*other_race sex*female LGBTQIA_2*LGBTQIA_01
					RUCC_Metro_4*RUCC_01 Q88*telehealth_01 Health_Insurance_5cat*Medicare_01
					Health_Insurance_5cat*Medicaid_01 Health_Insurance_5cat*Uninsured_01
					Health_Insurance_5cat*OtherInsure_01 LaidOff_CloseBus_Self_2*LaidOff_01
					LaidOff_CloseBus_Self_2*LaidOffDK_01/ list missing;
			run;


	*Using PROC REG to identify VIF*;
	proc reg data=covid_No_DNA;
		model Care_Disruption=Discrimination income Q7 education_recode CarTransportation
				black other_race female LGBTQIA_01 RUCC_01 telehealth_01 Medicare_01
				Medicaid_01 Uninsured_01 OtherInsure_01 LaidOff_01 LaidOffDK_01/ VIF ;
		run;
		quit;
		*All VIF are under 2, no evidence of multicollinearity.*;

*Update 061223: SENSITIVITY ANALYSIS: adding num_comorbid_cat to model to see if this changes results*;
	proc logistic data=covid_No_DNA plots=all order=internal;
		class race_3cat (ref='Non-Hispanic White') sex LGBTQIA_2 RUCC_Metro_4 (ref='Metro') Q88 (ref='No') CarTransportation (ref='No')
				Health_Insurance_5cat (ref='Private') LaidOff_CloseBus_Self_2 (ref='No') num_comorbid_cat (ref="0") / param=ref;
		model Care_Disruption (desc)= race_3cat sex LGBTQIA_2  RUCC_Metro_4 Q88 CarTransportation 
				Health_Insurance_5cat LaidOff_CloseBus_Self_2 Discrimination income Q7 education_recode num_comorbid_cat / lackfit rsquare corrb;
		title 'Full model predicting probability of some care distruption -- sensitivity analysis adding num_comorbid_cat';
		format LGBTQIA_2 LGBTQIA. LaidOff_CloseBus_Self_2 laid_off.;
	run;
		*num_comorbid_cat is significant -- 3+ vs. 0 is driving the effect*;
		*only variable that changes significance is q88 (telehealth variable)
		p-value increases from 0.02 to 0.06 -- OR effects stay very similar*;

******Race stratified models******;
*Update 020921: exclude metro from these models by race due to small numbers*;
*Non-Hispanice Black/African American*;
proc logistic data=covid_No_DNA plots=all order=internal;
	class  sex LGBTQIA_2 Q88 (ref='No') CarTransportation (ref='No')
			Health_Insurance_5cat (ref='Private') LaidOff_CloseBus_Self_2 (ref='No')/ param=ref;
	model Care_Disruption (desc)=  sex LGBTQIA_2 education_recode Q88 CarTransportation 
			Health_Insurance_5cat LaidOff_CloseBus_Self_2 Discrimination income Q7 education_recode/ lackfit rsquare;
	title 'Non-Hispanic Black: Full model predicting probability of some care distruption -- continuous discrimination variable';
	format LGBTQIA_2 LGBTQIA. LaidOff_CloseBus_Self_2 laid_off.;
	where race_3cat=2;
run;
	*Update 06 12 23 - Sensitivity analysis -- What happens if we add num_comorbid_cat to models?*;
	proc logistic data=covid_No_DNA plots=all order=internal;
		class  sex LGBTQIA_2 RUCC_Metro_4 (ref='Metro') Q88 (ref='No') CarTransportation (ref='No')
				Health_Insurance_5cat (ref='Private') LaidOff_CloseBus_Self_2 (ref='No') 
				num_comorbid_cat (ref="0")/ param=ref;
		model Care_Disruption (desc)=  sex LGBTQIA_2 education_recode RUCC_Metro_4 Q88 CarTransportation 
				Health_Insurance_5cat LaidOff_CloseBus_Self_2 Discrimination income Q7 education_recode num_comorbid_cat/ lackfit rsquare;
		title 'Non-Hispanic Black: Full model predicting probability of some care distruption -- sensitivity analysis adding num_comorbid_cat';
		format LGBTQIA_2 LGBTQIA. LaidOff_CloseBus_Self_2 laid_off.;
		where race_3cat=2;
	run;
	* results stay similar to model within number of comorbidities variable, however, similar to the overall
		model above, number comorbidities is statistically significant p-value=0.006) -- 3+ vs. 1 
		is driving effect*;

*Non-Hispanic White*;
proc logistic data=covid_No_DNA plots=all order=internal;
	class  sex LGBTQIA_2  Q88 (ref='No') CarTransportation (ref='No')
			Health_Insurance_5cat (ref='Private') LaidOff_CloseBus_Self_2 (ref='No')/ param=ref;
	model Care_Disruption (desc)=  sex LGBTQIA_2 education_recode Q88 CarTransportation 
			Health_Insurance_5cat LaidOff_CloseBus_Self_2 Discrimination income Q7 education_recode/ lackfit rsquare;
	title 'Non-Hispanic White: Full model predicting probability of some care distruption -- continuous discrimination variable';
	format LGBTQIA_2 LGBTQIA. LaidOff_CloseBus_Self_2 laid_off.;
	where race_3cat=1;
run;
	*Update 06 12 23 - Sensitivity analysis -- What happens if we add num_comorbid_cat to models?*;
		proc logistic data=covid_No_DNA plots=all order=internal;
			class  sex LGBTQIA_2 RUCC_Metro_4 (ref='Metro') Q88 (ref='No') CarTransportation (ref='No')
					Health_Insurance_5cat (ref='Private') LaidOff_CloseBus_Self_2 (ref='No') 
					num_comorbid_cat (ref="0")/ param=ref;
			model Care_Disruption (desc)=  sex LGBTQIA_2 education_recode RUCC_Metro_4 Q88 CarTransportation 
					Health_Insurance_5cat LaidOff_CloseBus_Self_2 Discrimination income Q7 education_recode
					num_comorbid_cat / lackfit rsquare;
			title 'Non-Hispanic White: Full model predicting probability of some care distruption -- sensitivity analysis adding num_comorbid_cat';
			format LGBTQIA_2 LGBTQIA. LaidOff_CloseBus_Self_2 laid_off.;
			where race_3cat=1;
		run;
			*only variable that changes significance is q88 (telehealth variable)
			p-value increases from 0.046 to 0.15 -- OR effects stay very similar*;
			*number of comorbidities variable is borderline not significant -- p-value= 0.052, 
			but one of the ORs confidence intervals does not span 1.*;

	

/*Other Race/ethnicity -- these results are not reported due to small numbers, unreliable model*;
proc logistic data=covid_No_DNA plots=all order=internal;
	class  sex LGBTQIA_2  Q88 (ref='No') CarTransportation (ref='No')
			Health_Insurance_5cat (ref='Private') LaidOff_CloseBus_Self_2 (ref='No')/ param=ref;
	model Care_Disruption (desc)=  sex LGBTQIA_2 education_recode  Q88 CarTransportation 
			Health_Insurance_5cat LaidOff_CloseBus_Self_2 Discrimination income Q7 education_recode/ lackfit rsquare;
	title 'Other Race/Ethnicity: Full model predicting probability of some care distruption -- continuous discrimination variable';
	format LGBTQIA_2 LGBTQIA. LaidOff_CloseBus_Self_2 laid_off.;
	where race_3cat=3;
run;*/

	
